package com.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

import java.util.Map;

// 用于Jpa的数据转换aop
@Aspect
@Component
public class DaoAop {


    @Around("@annotation(DaoToModel)")
    public Object checkFrontUserLogin(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {

        Object result = proceedingJoinPoint.proceed();
        if(result == null) return null;
        if(result instanceof Map) {


        }else {
            return result;
        }

        return result;
    }

}
